<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>未上架商品</strong></div>
        <div class="fixed-empty"></div>
        <form method="post" action="{:U('Goods/shelves')}" name="formSearch" id="formSearch">
        <table class="table tb-type2">
            <tbody>
                <tr>
                    <td width="8%"><label style="font-weight: bold;">商品名称：</label></td>
                    <td width="20%"><input class="input" type="text" name="goods_title" value="" /></td>
                    <td width="5%"><label style="font-weight: bold;">店铺：</label></td>
                    <td width="20%"><input class="input" type="text" name="store_name" value="" /></td>
                    <td width="10%"><button class="button bg-blue" type="submit">查询</button></td>
                    <td width="*"></td>
                </tr>
            </tbody>
        </table>
        </form>

        <form method="post" name="myform" id="myform" action="">
            <table class="table tb-type2 nobdb">
                <thead>
                    <tr class="thead">
                        <th>序号</th>
                        <th width="4%">图片</th>
                        <th>商品名称</th>
                        <th>店铺</th>
                        <th width="5%">进货价</th>
                        <th width="4%">销售价</th>
                        <th width="4%">市场价</th>
                        <th width="4%">销量</th>
                        <th width="4%">浏览</th>
                        <th width="16%">操作</th>
                    </tr>
                </thead>
                <tbody>
                <foreach  name="res" item="vo" key="key">
                    <tr class="hover" style="background: rgb(255, 255, 255);">
                        <td class="oGoods">{$vo['goods_id']}</td>
                        <td><img src="{$vo['goods_thumb']}!100x100" height="24" width="24" /></td>
                        <td><a href="{:HOME_URL}/Goods/{$vo['goods_id']}" target="_blank">{$vo['goods_title']}</a></td>
                        <td>{$vo['store_name']}</td>
                        <td class="nowrap align-center">{$vo['goods_stockprice']}</td>
                        <td class="align-center">{$vo['goods_price']}</td>
                        <td class="align-center">{$vo['goods_markprice']}</td>
                        <td class="align-center">{$vo['goods_realsale']}</td>
                        <td class="align-center">{$vo['goods_hits']}</td>
                        <td class="w144 align-center">
                            <a class="button bg-red button-little" href="javascript:" data="1" title="上架" onclick="shangjia({$vo['goods_id']})"><i class="icon-minus-circle"></i>上架</a>
                            <a class="button bg-red button-little js-del" href="javascript:" data="1" title="删除" onclick="huishou({$vo['goods_id']})"><i class="icon-minus-circle"></i>删除</a>
                            <a class="button bg-blue button-little" href="{:U('/Goods/edit',array('goods_id'=>$vo['goods_id']))}"><i class="icon-edit"></i>编辑</a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
                <tfoot class="panel-foot">
                    <tr>
                        <td colspan="15"><div class="pages clearfix">{$pages}</div></td>
                    </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>
<script>
    function huishou(dete)
    {
    layer.confirm(
            '确定要放入回收站？',
    {btn: ['是的', '算了'] },
            function(){
            dete = {goods_id:dete};
            var p = Aajax("{:ADMIN_URL}{:U('Goods/goods_del_huishou')}", dete);
            if (p.n){
            layer.msg('商品已放入回收站');
            setTimeout("history.go(0)", 1500);
            } else{
            layer.msg('出错请稍后再试');
            }
            }
    );
    }

    function shangjia(dete)
    {
    layer.confirm(
            '确定要放回下架？',
    {btn: ['是的', '算了'] },
            function(){
            dete = {goods_id:dete};
            var p = Aajax("{:ADMIN_URL}{:U('Goods/goods_del_shangjia')}", dete);
            if (p.n){
            layer.msg('商品已入上架');
            setTimeout("history.go(0)", 1500);
            } else{
            layer.msg('出错请稍后再试');
            }
            }
    );
    }

</script>